<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class CreateDepositsTable.
 */
class CreateDepositsTable extends Migration
{
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('deposits', function(Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('staff_id');
            $table->unsignedInteger('user_id')->nullable();
            $table->unsignedInteger('period_id')->nullable();
            $table->unsignedInteger('deposit_type_id');
            $table->date('deposit_date');
            $table->tinyInteger('status')->default(0)->comment('-1 退还 0 待收 1 收取 2 扣除');
            $table->string('remark')->nullable();
            $table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('deposits');
	}
}
